#!/usr/bin/perl

$temp = `i2cget -y 1 0x70 0x00`;
$temp = sprintf("%s\n", $temp);
#$temp = hex($temp);
print $temp, "\n";



I2C_Write2(0x01,0x03);
I2C_Write2(0x02,0x80);
I2C_Write2(0x00,0x51);            // Register 0, Ausgabe Distanz in mm
usleep(750000);                   // Wartezeit bis Distanzermittlung abgeschlossen ca. 65us
I2C_Write1(0x00);               // Send Register to send from
I2C_Read(buf,4);

unsigned char highByte = buf[2];
unsigned char lowByte = buf[3];
unsigned int result = (highByte <<8) + lowByte; // Calculate range as a word value
printf("Software v: %u \n",buf[0]);
printf("Range was: %u\n",result);
return(result);

}
